# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.CloudSupport.V2.Model.Actor do
  @moduledoc """
  An Actor represents an entity that performed an action. For example, an actor could be a user who posted a comment on a support case, a user who uploaded an attachment, or a service account that created a support case.

  ## Attributes

  *   `displayName` (*type:* `String.t`, *default:* `nil`) - The name to display for the actor. If not provided, it is inferred from credentials supplied during case creation. When an email is provided, a display name must also be provided. This will be obfuscated if the user is a Google Support agent.
  *   `email` (*type:* `String.t`, *default:* `nil`) - The email address of the actor. If not provided, it is inferred from the credentials supplied during case creation. When a name is provided, an email must also be provided. If the user is a Google Support agent, this is obfuscated. This field is deprecated. Use **username** field instead.
  *   `googleSupport` (*type:* `boolean()`, *default:* `nil`) - Output only. Whether the actor is a Google support actor.
  *   `username` (*type:* `String.t`, *default:* `nil`) - Output only. The username of the actor. It may look like an email or other format provided by the identity provider. If not provided, it is inferred from the credentials supplied. When a name is provided, a username must also be provided. If the user is a Google Support agent, this will not be set.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :displayName => String.t() | nil,
          :email => String.t() | nil,
          :googleSupport => boolean() | nil,
          :username => String.t() | nil
        }

  field(:displayName)
  field(:email)
  field(:googleSupport)
  field(:username)
end

defimpl Poison.Decoder, for: GoogleApi.CloudSupport.V2.Model.Actor do
  def decode(value, options) do
    GoogleApi.CloudSupport.V2.Model.Actor.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.CloudSupport.V2.Model.Actor do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
